<template>
	<view>
		<uni-card >
			<!-- title="湘南院区" sub-title="北京市大兴区****路909号" extra="额外信息" :thumbnail="avatar" @click="onclick(item)" -->
			<view style="margin: 20px 0px 0px 20px;width: 30%;float: left;">
				<image style="width: 100%; height: 120px;" :src="campus.campusImgs">
			</view>
			<view style="width: 60%;height: 120px;float: left;margin: -130px 0px 0px 160px;">
				<view style="font-size: 22px;letter-spacing: 5px;">
					<text>{{campus.campusName}}</text>
				</view>
				<view style="height: 20px;width: 100%;"></view>
				<view style="font-size: 18px;letter-spacing: 3px;">
					<text>{{campus.campusAddress}}</text>
				</view>
			</view>
			<view style="width: 100%;height: 180px;"></view>
			<view>
				<text class="t1">电话</text>
				<view style="float: left;margin: 0px 0px 0px 10px;">
					<u-icon name="phone" color="#2979ff" size="28"></u-icon>
				</view>
				<text class="t2">{{campus.campusPhone}}</text>
			</view>
				<view style="width: 100%;height: 40px;"></view>
			<view>
				<view style="border:2px solid #f2f2f2;clear: both;"></view>
				<view style="width: 100%;height: 10px;"></view>
				<view style="height: 10px;"></view>
				<view style="clear: both;">
					<text class="t4">公交</text>
					<!-- <u-icon name="phone" color="#2979ff" size="28"></u-icon> -->
					<text class="t3">{{campus.busLine}}</text>
					<view style="height: 30px;"></view>
				</view>
			</view>

			<view style="width: 100%;height: 20px;"></view>
		</uni-card>

		<uni-card>
			<view style="width: 100%;height: 50px;" @click="ditu()">
				<view style="width: 100%;height: 10px;"></view>
				<u-icon name="map-fill" color="#2979ff" size="28"></u-icon>
				<text class="t5">地图导航</text>
				<view class="tb1">
				<u-icon name="arrow-right" color="#2979ff" size="28"></u-icon>
				</view>
			</view>
		</uni-card>

		<uni-card>
			<view style="width: 100%;height: 50px;" @click="yuannei()">
				<view style="width: 100%;height: 10px;"></view>
				<u-icon name="map" color="#2979ff" size="28"></u-icon>
				<text class="t5">院内导航</text>
				<view class="tb1">
				<u-icon name="arrow-right" color="#2979ff" size="28"></u-icon>
				</view>
			</view>
		</uni-card>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:0,
				avatar: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png',
				campus:{}
			}
		},
		onLoad(res) {
			console.log(res)
			this.id = res.id;
			console.log("id:::"+this.id)
			this.findxwID();
		},
		methods: {
			yuannei() {
				uni.navigateTo({
					url: "./loucensuoyin?id=" + this.campus.id,
					// url: "./details?id=" + e.id,
				})
			},
			ditu(){
				uni.navigateTo({
					url: "tes/tes",
					// url: "./details?id=" + e.id,
				})
			},
			
			
			findxwID() {
				uni.request({
					url: "http://localhost:9000/user/user/campus/findByCampusID/" + this.id,
					method: 'get',
					success: (res) => {
						console.log(res)
						this.campus = res.data.data.campus
					}
				})
			},
		}
	}
</script>

<style>
	.t1 {
		font-size: 20px;
		float: left;
		margin: 0px 0px 0px 0px;
	}

	.t2 {
		float: left;
		font-size: 16px;
		margin: 0px 0px 0px 80px;
	}

	.t4 {
		float: left;
		font-size: 20px;
		margin: 0px 0px 0px 0px;
	}

	.t3 {
		float: left;
		font-size: 16px;
		margin: -30px 0px 0px 80px;
	}
	
	.t5 {
		font-size: 20px;
		float: left;
		margin: -25px 0px 0px 50px;
	}
	.tb1{
		float: left;
		font-size: 16px;
		margin: -30px 0px 0px 300px;
	}
	
</style>
